home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 52
/
Volume 52 - JOGO DISK .iso
/
Games
/
shopdrop.swf
/
scripts
/
__Packages
/
GrabPackage.as
< prev
next >
Wrap
Text File
|
2007-09-27
|
1KB
|
49 lines
class GrabPackage extends MovieClip
{
var bGrabbed = false;
static var NORMAL = 0;
static var BONUS = 1;
static var BALANCE = 2;
var nType = GrabPackage.NORMAL;
function GrabPackage()
{
super();
}
function update(nElapsed)
{
var _loc4_ = (- PackageHandler.ySpeed) * nElapsed;
this.lastY = this._y;
var _loc6_ = _loc4_ * this.direction.x;
this._x -= _loc6_;
this._y += _loc4_;
var _loc5_ = new smashing.Point(this.vanishing._x - this._x,this.vanishing._y - this._y);
var _loc3_ = Math.floor(_loc5_.dot(_loc5_) / this.distance2 * 100);
this._xscale = _loc3_;
this._yscale = _loc3_;
this.newDepth = this._y <= _global.nPlayerY ? 300 + this.nId : 600 + this.nId;
this.swapDepths(this.newDepth);
if(this._y <= this.vanishing._y)
{
this.handler.removeClip(this);
}
}
function toGiftCard()
{
this.a.pickup.gotoAndStop("maxStack");
}
function toPackage()
{
this.a.pickup.gotoAndStop("default");
}
function toBonusCard()
{
this.nType = GrabPackage.BONUS;
this.a.pickup.gotoAndStop("bonusCard");
}
function toBalanceIcon()
{
this.nType = GrabPackage.BALANCE;
this.a.pickup.gotoAndStop("balance");
}
}